<template>
    <div class="header">
        <!-- 折叠按钮 -->
        <div class="collapse-btn" @click="collapseChage">
            <i v-if="!collapse" class="el-icon-s-fold"></i>
            <i v-else class="el-icon-s-unfold"></i>
        </div>
        <div class="logo" style="color:#409eff;margin-left:20px">
            <img src="../assets/img/LOGO.png" alt="" style="width:40px;height:40px;margin: -10px 0px;">
            大迈通PAAS平台
            </div>
        <!-- <div class="header-center">
            <div>
                <p>使用手册</p>
                <p>在线咨询</p>
                <p>客服电话:4006232-032</p>
            </div>
        </div> -->
        <div class="header-right">


            <div class="header-user-con">
                <div style="margin-right:50px;font-size:14px;cursor:pointer" @click="sysc()">使用手册</div>
                <div style="margin-right:50px;font-size:14px;cursor:pointer" @click="zxzx()">探客躺赚</div>
                <div style="margin-right:150px;font-size:14px">
                    客服电话: 4001-886-529
                </div>
                <div style="margin-right:100px;font-size:12px;cursor:pointer" @click="devApi()">
                    开发文档
                </div>
                    <div class="el-dropdown-link" @click="showMoney" style="font-size:12px;margin-right:10px">账号管理
                    </div>
                    <div class="sx"></div>
                <div @click="loginout()" style="font-size:12px;cursor:pointer">退出</div>
                
                
                
            </div>
        </div>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    data() {
        return {
            fullscreen: false,
            name: "",
            message: 2,
            money:"",
            indexApi:"http://118.190.2.70:9005/damaitong_api.pdf",//开发文档
            tktz:"http://tktz.damaitongxin.com"
        };
    },
    computed: {
        username() {
            let username = localStorage.getItem("ms_username");
            return username ? username : this.name;
        },
        collapse() {
            return this.$store.state.collapse;
        }
    },
    created(){
        
    },
    methods: {
        //使用手册
        sysc(){
            console.log("使用手册")
        },
        //在线咨询
        zxzx(){
            window.open(this.tktz,"_blank")
        },
        //开发文档
        devApi(){
            window.open(this.indexApi,"_blank")
        },
        showMoney(){
            let params = {
                id:localStorage.getItem("id")
                }
                axios
                .post("http://118.190.2.70:9999/vo/user/findOne", params)
                .then((res) => {
                this.money = res.data.data.money                
        })
        },
        //退出
        loginout(){
            this.$router.push("/login");
            axios.post("http://118.190.2.70:9999/vo/login/out")
                .then((res) =>{
                this.$message.success(res.data.message)
                })
                .catch(err=>{
                console.log(err)
                
                })
        },
        // 侧边栏折叠
        collapseChage() {
            this.$store.commit("hadndleCollapse", !this.collapse);
        },
        // getMoney(){
        //     this.allMoney = this.route.params.allMoney
        // },
        },
        //账户余额请求接口
        
        mounted() {
        if (document.body.clientWidth < 1500) {
            this.collapseChage();
        }
        },
        //账户信息
        account(){
            
        }
};
</script>
<style scoped>
.header {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 70px;
    font-size: 22px;
    color: #fff;
}
.header-center{
    width: 500px;
    display: flex;
    /* justify-content: center; */
    align-items: center;
}
.sx{
    content: '';
    /* position: absolute; */
    left: 0;
    bottom: 0;
    top: 0;
    margin: auto 20px;
    width: 1px;
    height: 20px;
    background-color: #999;
}
.collapse-btn {
    float: left;
    padding: 0 21px;
    cursor: pointer;
    line-height: 70px;
}
.header .logo {
    float: left;
    width: 250px;
    line-height: 70px;
}
.header-right {
    float: right;
    padding-right: 50px;
}
.header-user-con {
    display: flex;
    height: 70px;
    align-items: center;
}
.btn-fullscreen {
    transform: rotate(45deg);
    margin-right: 5px;
    font-size: 24px;
}
.btn-bell,
.btn-fullscreen {
    position: relative;
    width: 30px;
    height: 30px;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
}
.btn-bell-badge {
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #f56c6c;
    color: #fff;
}
.btn-bell .el-icon-bell {
    color: #fff;
}
.user-name {
    margin-left: 10px;
}
.user-avator {
    margin-left: 20px;
}
.user-avator img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.el-dropdown-link {
    color: #fff;
    cursor: pointer;
}
.el-dropdown-menu__item {
    text-align: justify;
    border:0ch;
}
/* 隐藏横线 */
/* .balance{
    border:0ch;

} */
</style>
